package com.pet.cloud.console.api.controller;

import com.pet.cloud.console.api.handler.command.TenantCommandHandler;
import com.pet.cloud.console.api.handler.query.TenantQueryHandler;
import com.pet.cloud.console.api.param.OpenedPermissionParam;
import com.pet.cloud.console.api.param.QueryPermissionParam;
import com.pet.cloud.console.api.param.TenantSaveParam;
import com.pet.cloud.console.api.view.TenantSettledView;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

@Slf4j
@RestController
@RequestMapping("/tenant")
public class TenantController {


    @Resource
    private TenantCommandHandler tenantCommandHandler;

    @Resource
    private TenantQueryHandler tenantQueryHandler;

    /**
     * 租户入驻
     */
    @PostMapping(value = "/settled")
    public TenantSettledView settled(@Valid @RequestBody TenantSaveParam param) {
        return tenantCommandHandler.tenantSettled(param);
    }

    /**
     * 租户信息变更
     */
    @PostMapping(value = "/modify")
    public void modify(@Valid @RequestBody TenantSaveParam param) {

    }

    /**
     * 开通权限
     */
    @PostMapping(value = "/opened-permission")
    public void openedPermission(@Valid @RequestBody OpenedPermissionParam param) {

    }

    /**
     * 权限查询
     */
    @PostMapping(value = "/find-permission-list")
    public void findPermission(@Valid @RequestBody QueryPermissionParam param) {

    }


}
